# 获取用户输入的两个数字
a = float(input("请输入数字a："))
b = float(input("请输入数字b："))

# 计算和、差、积
sum_ab = a + b
difference_ab = a - b
product_ab = a * b

# 计算商，添加错误处理以避免除零错误
try:
    quotient_ab = a / b
except ZeroDivisionError:
    quotient_ab = "undefined"  # 如果b为0，则商未定义

# 输出结果
print(f"a和b的和是：{sum_ab}")
print(f"a和b的差是：{difference_ab}")
print(f"a和b的积是：{product_ab}")
print(f"a和b的商是：{quotient_ab}")